$(document).ready(function(){
    $("#inputError").hide();
    $(".ln_li").click(function () {
      var name=$(this).text();
        $(".fade").hide();
        var value = $(this).children("img").attr("src");
        console.info(value);
        $(".lockscreen-image").children("img").attr("src",value);
        $(".lockscreen-name").text(name)
    });

    $(".btn").click(function(){

        var name = $(".lockscreen-name").text().trim();
        var password = $(".form-control").val();
        $.ajax({
            url:"/user/login",
            //传送请求数据
            data: { name: name, passWord: password },
            success:function(result){
                console.info(result);
                if(result){
                    window.location.href ="/activity/index";
                }else{
                    $("#inputError").show();
                    $("#inputError").children("label").text("密码错误，请重新输入");
                }
        }});
    });
});